import {defineStore} from "pinia";

export const useCountStore = defineStore({
    id: 'counter',
    state:()=>({
      count: 0
    }),
    getters:{
       doubleCount(state){
           return state.count * 2
       }
    },
    actions:{
        increment(payload){
            this.count += payload;
        },
        decrement( payload){
            this.count -= payload
        },
        reset(){
            this.count = 0
        }
    }
})